<template>
  <el-card shadow="never" class="aui-card--fill">
    <div class="content">
      <div class="title">
        <h2>公告列表</h2>
        <div class="title_box">
          <img class="title_box_img" src="../../assets/img/download.png" width="100px">
          <div class="title_box_content">
            <h2>这是什么？</h2>
            <p>在这里你能看见学校发布的公告列表！一览最新动态！</p>
          </div>
        </div>
      </div>
      <p style="color: rgb(154, 154, 154);">全部公告</p>
      <div class="notice" v-for="item in dataList" :key="item.id">
        <h2 style="font-size: larger;">{{item.noticeTypeName}}</h2>
        <el-card class="box-card">
          <el-tag size="small" type="success" effect="dark">阅读</el-tag>
          <div style="margin-top: 10px;">
            <span style="font-size: larger;">{{item.title}}</span>
            <el-button style="float: right; padding: 3px 0" type="text" @click="toNoticeDetail(item.id)"><i class="el-icon-arrow-right"></i></el-button>
          </div>
        </el-card>
      </div>
      <el-pagination :current-page="page" :page-sizes="[10, 20, 50, 100]" :page-size="limit" :total="total"
        layout="total, sizes, prev, pager, next, jumper" @size-change="pageSizeChangeHandle"
        @current-change="pageCurrentChangeHandle">
      </el-pagination>
    </div>
  </el-card>
</template>

<script>
import mixinViewModule from "@/mixins/view-module";
export default {
  mixins: [mixinViewModule],
  data() {
    return {
      mixinViewModuleOptions: {
        getDataListURL: "/grant/noticeList/home/page",
        getDataListIsPage: true
      },
    };
  },
  activated() {
    this.getDataList();
  },
  methods: {
    // 跳转公告详情页面
    toNoticeDetail(item) {
      this.$router.push({ name: 'noticeDetail', params: { id: item } })
    }
  }
}
</script>

<style scoped>
.content {
  width: 80%;
  margin-left: 10%;
}
.title_box {
  display: flex;
  align-items: center;     /* 垂直居中 */
  height: 100px;
  background-color: rgb(220, 222, 228);
  border-radius: 10px;
}
.title_box_img {
  margin-left: 50px;
}
.title_box_content {
  margin-left: 50px;
}
</style>
